<?php if (!defined('THINK_PATH')) exit();?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/Public/admin/lib/html5shiv.js"></script>
<script type="text/javascript" src="/Public/admin/lib/respond.min.js"></script>
<![endif]-->
<link href="/Public/admin/css/public.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="/Public/admin/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/Public/admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/Public/admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/Public/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/Public/admin/static/h-ui.admin/css/style.css" />
<style>
  .tableBasic tbody tr{
    height:80px;
  }
</style>
<!--[if IE 6]>
<script type="text/javascript" src="/Public/admin/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>修改分类</title>
</head>
<body>
<div class="page-container">
    <h3><a href="<?php echo U('Column/index');?>" class="actionBtn">栏目分类</a>修改分类</h3>
    <form action="<?php echo U('Column/editdo');?>" method="post">
     <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
     <input type="hidden" name="id" value="<?php echo ($arr['id']); ?>">
      <tr>
       <td width="80" align="right">分类名称</td>
       <td>
        <input type="text" name="name" value="<?php echo ($arr['name']); ?>" size="40" class="inpMain" />
       </td>
      </tr>
            <tr>
       <td width="80" align="right">类别描述</td>
       <td>
        <textarea name="content" id="" cols="30" rows="10"><?php echo ($arr['content']); ?></textarea>
       </td>
      </tr>
<!--       <tr>
       <td align="right">上级分类</td>
       <td>
        <select name="pid">
         <option value="0">一级分类</option>
             <?php if(is_array($list)): foreach($list as $key=>$m): ?><option value="<?php echo ($m["id"]); ?>"><?php echo ($m["name"]); ?></option><?php endforeach; endif; ?>
        </select>
       </td>
      </tr> -->
            <tr>
       <td width="80" align="right">缩略图上传</td>
       <td>
       <a href="javascript:void();" class="btn btn-primary upload-btn" id='sc'><i class="Hui-iconfont">&#xe642;</i> 上传图片</a>
        <input type="file" name="img" value="" size="40" style="display:none" id="img1" />
        <img src="<?php echo ($arr["image"]); ?>" alt="" id='photo' style="width:200px;">
       </td>
      </tr>
      <input type="hidden" name='image' value='<?php echo ($arr["image"]); ?>' id="image">  
      <tr>
       <td></td>
       <td>
        <input class="btn btn-primary upload-btn"  id ='sub' type="submit" value="提交" />
       </td>
      </tr>
     </table>
    </form>
       </div>
 </div>
</div>
<footer class="footer mt-20">
<!--   <div class="container">
    <p>感谢jQuery、layer、laypage、Validform、UEditor、My97DatePicker、iconfont、Datatables、WebUploaded、icheck、highcharts、bootstrap-Switch<br>
      Copyright &copy;2015-2017 H-ui.admin v3.1 All Rights Reserved.<br>
      本后台系统由<a href="/Public/admin/http://www.h-ui.net/" target="_blank" title="H-ui前端框架">H-ui前端框架</a>提供前端技术支持</p>
  </div> -->
</footer>
<script type="text/javascript" src="/Public/admin/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/Public/admin/static/h-ui/js/H-ui.min.js"></script> 
<script src="/Public/admin/js/ajaxfileupload.js"  type="text/javascript"></script>

</body>
</html>
<script>
  $('#sc').on('click', function(e) {
    
      e.preventDefault();
      $('[name=img]').trigger('click');

  })
   var prePath2 = $('[name=img]').val();
    $('[name=img]').change(function(){
        var curPath = $('[name=img]').val();
        if (prePath2 == curPath) {
            return false;
        }
        prePath2 = curPath;
         $.ajaxFileUpload({  
            url:"<?php echo U('add_photo');?>",  
            fileElementId:'img1',
            dataType: 'json',
            success:function(data){
                if(data.result_code==100){

                    $("#photo").attr("src",data.file);
                    $("#image").val(data.file);
                }else{
                    return false;   
                }
            }

        });        
    });
</script>